package com.sixth.util;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: 145ssm
 * @description:
 * @author: 闫克起2
 * @create: 2021-12-10 09:10
 **/
@Data
@NoArgsConstructor
public class CommonResult {
    private Integer code;
    private String msg;
    private Object data;
    public CommonResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


    public static CommonResult success() {
        return new CommonResult(1, "操作成功", (Object)null);
    }

    public static CommonResult success(Object data, String msg) {
        return new CommonResult(1, msg, data);
    }

    public static CommonResult fail() {
        return new CommonResult(2, "操作失败", (Object)null);
    }

    public static CommonResult fail(String msg) {
        return new CommonResult(2, msg, (Object)null);
    }

}
